<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@page import="entity.Movie"%>
<%@page import="dao.*"%>
<%@ page language="java" import="java.util.*"%>  
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";

MovieDao moviedao = new MovieDao();
ArrayList<Movie> cs = moviedao.findFive();
if(cs==null)
	System.out.println("miss");
%>
<!DOCTYPE html>
<html>

    <head>
    <title>电影网</title>
        <meta charset="utf-8">
        <link href="css/bootstrap.css" rel="stylesheet">
		<link href="css/bootstrap.min.css" rel="stylesheet">
    </head>
        <script src="js/jquery-2.2.3.js"></script>
        <script src="js/bootstrap.min.js"></script>

    <body>
   <nav class="navbar navbar-default" role="navigation">
   <div class="navbar-header">
      <a class="navbar-brand" href="index.jsp">电影网</a>
   </div>
    <div>
      <ul class="nav navbar-nav">
         <li><a href="movie.jsp">所有电影</a></li>
         <li><a href="inform.jsp">我的电影</a></li> 
      </ul>
    <% if(session.getAttribute("id")==null){ %>
      <ul class="nav navbar-nav navbar-right">
         <li><a href="login.jsp">登录</a></li>
         <li><a href="register.jsp">注册</a></li>   
      </ul>
      <%  } 
      	else {
String uid = session.getAttribute("id").toString();
UserDao userdao = new UserDao();
String username = userdao.findById(uid);%>
      	 <ul class="nav navbar-nav navbar-right">
         <li><a>欢迎你,<%=username %></a></li>
         <li><a href="loginout.jsp">退出</a></li>   
      </ul>
      <% } %>
</div>

</nav>
	<div class="col-sm-12">
        <div id="carousel-example" class="carousel slide" data-ride="carousel">
            <!-- Indicators -->
            <ol class="carousel-indicators">
                <li data-target="#carousel-example" data-slide-to="0" class="active"></li>
                <li data-target="#carousel-example" data-slide-to="1"></li>
                <li data-target="#carousel-example" data-slide-to="2"></li>
            </ol>
            <!-- Wrapper for slides -->
            <div class="carousel-inner">
                <div class="item active">                	
                    	<img src="img/meidui2.jpg" alt="..."  />
                    <div class="carousel-caption">
                    </div>
                </div>
                <div class="item">
                    <img src="img/bainiao1.jpg" alt="..."  />
                    <div class="carousel-caption">...</div>
                </div>
                <div class="item">
                    <img src="img/chaonao2.jpg" alt="..."  />
                    <div class="carousel-caption">...</div>
                </div>
            </div>
            <!-- Controls -->
            <a class="left carousel-control" href="#carousel-example" data-slide="prev">
                <span class="glyphicon glyphicon-chevron-left"></span></a>
            <a class="right carousel-control" href="#carousel-example" data-slide="next">
                <span class="glyphicon glyphicon-chevron-right"></span></a>
        </div>
      </div>
        
 <div class="container-fluid">
 	<div class="row-fluid">
 		<div class="clearfix" style="margin-bottom: 60px;"></div>
 		
 			<div class="col-sm-12" style="margin-left:100px">
 				<div class="col-sm-12">
 	 				<h3>热门电影</h3> 
 	 			</div>
 	 			<%for(Movie c:cs){ %>
 	 			<div class="col-sm-2">
 	 				<div class="thumbnail">
 	 					<img src="<%=c.getPicture()%>" style="height: 232px;">
 	 					<div class="caption">
 	 						<h4><%=c.getName()%></h4>
            				<p style="font-size: 25px;color:orange"><%=c.getMark() %></p>
 	 					</div>
 	 					
 	 				</div>
 	 			</div>
 	 				<%} %>
 	 		</div>
 	</div>
 </div>
 
<div class="center-block" style="height:100px; margin-top:40px;margin-bottom:0px;background-color:#dedede">
	<div class="center-block" style="width:600px;padding-top:10px;text-align: center;">	
		<a href="adminlogin.jsp" style="text-decoration: none;color:black;">管理登录</a><p></p>
		<small>技术支持：本科15栋607</small>
		<p>All Rights Reserved 电子科技大学计算机学院</p>
	</div>
	
</div>

			

</body>

</html>